import 'package:boss/provider/commodity_provider.dart';
import 'package:boss/textStyle/text_style.dart';
import 'package:hi_common/hi_common.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

class CategoriesMessage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Container(
      height: 80.w,
      padding: EdgeInsets.only(
        left: 20.w,
      ),
      alignment: Alignment.centerLeft,
      child: Consumer<CommodityProvider>(
        builder: (context, commodityProvider, child) {
          return RichText(
            text: TextSpan(
              text: '【${commodityProvider.currentMenuCategory?.menuName ?? '--'}】',
              style: TextStyleConstant().normal_1_28,
              children: [
                TextSpan(
                  text: '${commodityProvider.currentCommodities.length}个',
                  style: TextStyleConstant().normal_4_24,
                ),
              ],
            ),
          );
        },
      ),
    );
  }
}
